﻿using System;
using AzureContrib.WindowsAzure.Diagnostics;

namespace MyAnt.Playing
{
	public class SomePieceOfWork
	{
		private readonly ITrace trace;
		private readonly Random random;

		public SomePieceOfWork(ITrace trace)
		{
			this.trace = trace;

			random = new Random(DateTime.Now.Second);
		}

		public void DoWork()
		{
			if (random.Next(0, 2) == 0)
			{
				trace.Information("Progressing fine!");
			}
			else
			{
				trace.Error("Failed - doh!");
			}
		}
	}
}